<%@ page import="java.util.*"%>
<%@page import="web.Searchmasp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!-- tao form tim kiem -->
	<form method="post" name="frm" action="Searchmasp"
		style="width: 917px;">
		<table border="0" width="300" align="center" bgcolor="#eeffee"
			style="width: 844px;">
			<tr>
			</tr>
			<tr>
				<td style="width: 269px;"><b>Tìm kiếm theo mã sản phẩm </b></td>
				<td style="width: 334px;"><input type="text" name="pid"
					id="pid" style="width: 292px;"></td>
				<td><input type="submit" name="submit" value="Search"></td>
			</tr>
			<tr>
				<td colspan=2 align="center"></td>
				<td></td>
			</tr>
		</table>
	</form>
	<table width="700px" align="center" style="border: 1px solid #000000;">
		<tr>
			<td colspan=4 align="center" style="background-color: teal"><b>User
					Record</b></td>
		</tr>
		<tr style="background-color: lightgrey;">
			<td><b>Mã Sản Phẩm</b></td>
			<td><b>Tên Sản Phẩm</b></td>
			<td><b>Giá </b></td>
			<td><b>Thông tin Sản Phẩm</b></td>

		</tr>
		<%
                int count = 0;
                String color = "#F9EBB3";
                if (request.getAttribute("piList") != null) {
                    ArrayList al = (ArrayList) request.getAttribute("piList");
                    System.out.println(al);
                    Iterator itr = al.iterator();
                    while (itr.hasNext()) {
 
                        if ((count % 2) == 0) {
                            color = "#eeffee";
                        }
                        count++;
                        ArrayList pList = (ArrayList) itr.next();
            %>
		<tr style="background-color:<%=color%>;">
			<td><%=pList.get(0)%></td>
			<td><%=pList.get(1)%></td>
			<td><%=pList.get(2)%></td>
			<td><%=pList.get(3)%></td>

		</tr>
		<%
                    }
                }
                if (count == 0) {
            %>
		<tr>
			<td colspan=4 align="center" style="background-color: #eeffee"><b>No
					Record Found..</b></td>
		</tr>
		<%            }
            %>
	</table>
</body>
</html>